<html>
<head>
<link rel="shortcut icon" href="./favicon.ico">
<link rel="stylesheet" type="text/css" href="./style.css">
<link rel="canonical" href="./Constant.html">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Normally this is merely a `localparam` inside another module, but it may be useful implemented as a module on its own to work with other IP systems such as Xilinx's IPI (IP Integrator), where you may need to feed an IP block a constant value.">
<title>Constant</title>
</head>
<body>

<p class="inline bordered"><b><a href="./Constant.v">Source</a></b></p>
<p class="inline bordered"><b><a href="./legal.html">License</a></b></p>
<p class="inline bordered"><b><a href="./index.html">Index</a></b></p>

<h1>A Constant Value Output</h1>
<p>Normally this is merely a <code>localparam</code> inside another module, but it may
 be useful implemented as a module on its own to work with other IP systems
 such as Xilinx's IPI (IP Integrator), where you may need to feed an IP
 block a constant value.</p>

<pre>
`default_nettype none

module <a href="./Constant.html">Constant</a>
#(
    parameter                   WORD_WIDTH  = 0,
    parameter  [WORD_WIDTH-1:0] VALUE       = 0
)
(
    output reg [WORD_WIDTH-1:0] constant_out
);

    initial begin
        constant_out = VALUE;
    end

endmodule
</pre>

<hr>
<p><a href="./index.html">Back to FPGA Design Elements</a>
<center><a href="https://fpgacpu.ca/">fpgacpu.ca</a></center>
</body>
</html>

